package com.roin.tools;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

import java.io.IOException;

/**
 * JavaFX App
 */
public class App extends Application {

    private static Scene scene;
    private static Stage myStage;

    @Override
    public void start(Stage stage) throws IOException {
        myStage = stage;
        scene = new Scene(loadFXML("MainFrame"),650,550);
        stage.setScene(scene);
        stage.setTitle("文件小工具");
        stage.getIcons().add(new Image(App.class.getResourceAsStream("images/logo.jpg")));
        stage.setResizable(false);
        stage.show();
    }

    private static Parent loadFXML(String fxml) throws IOException {
        FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml"));
        Parent parent=fxmlLoader.load();
        return parent;
    }

    public static void main(String[] args) {
        launch();
    }

    public static Stage getStage() {
        return myStage;
    }
}